<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title><%=title%></title>
    <script>
        function stop() {
            return false;
        }
        document.oncontextmenu = stop;
    </script>
    <script>
        function showdiv(targetid,objN){
            var target=document.getElementById(targetid);
            var clicktext=document.getElementById(objN)
            var image = document.getElementById('image1');
            if (clicktext.style.display == "block")
            {
                clicktext.style.display = "none";
                target.innerText = "查看说明（展开答题说明）";
                image.src = "images/03test/sq.png";
            }
            else
            {
                clicktext.style.display = "block";
                target.innerText = "查看说明（关闭答题说明）";
                image.src = "images/03test/fx.png";
            }
        }
    </script>
    <script>
        function SelecteChanged(obj)
        {
            var oDiv = document.getElementsByTagName('input');
            for (var i = 0; i < oDiv.length; i++)
            {
                if (oDiv[i].type == 'checkbox')
                {
                    oDiv[i].checked = false;
                }
            }
            obj.checked = true;
            var xmlhttp;
            if (window.XMLHttpRequest)
            {
                xmlhttp = new XMLHttpRequest();
            }
            else
            {
                xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
            }
            var num= document.getElementById('num').innerText.replace("第","").replace("题","");
            xmlhttp.open("GET", "/submit?daan="+obj.value.substring(0,1)+"&num="+num, true);
            xmlhttp.send();
        }
    </script>
    <script>
        function showtoop() {
            var target = document.getElementById('toop1');
            if (target.style.display == "block") {
                target.style.display = "none";
            }
            else {
                target.style.display = "block";
                var myfs,pagecount,fsarry,lastcount;
                var cooktep=decodeURI(document.cookie);
                alert(cooktep);
                var arrstr = cooktep.split("; ");
                for (var i = 0; i < arrstr.length; i++) {
                    var temp = arrstr[i].split("=");
                    if (temp[0] == "report") {
                        myfs = temp[1];
                    }
                    if (temp[0]  == "papercount") {
                        pagecount = temp[1];
                    }
                }
                fsarry = myfs.split('|');
                lastcount = pagecount - fsarry.length + 1;
                if (lastcount > 0) {
                    document.getElementById('tsone').innerHTML = '您还有' + lastcount + '道试题未答，确认要交卷吗?<br>交卷后将完成本次考试!';
                }else
                {
                    document.getElementById('tsone').innerHTML = '确认提交试卷吗？<br>交卷后将完成本次考试!';
                }
            }
        }

        function showcross()
        {
            var target = document.getElementById('toop2');
            if (target.style.display == "block") {
                target.style.display = "none";
            }
            else {
                target.style.display = "block";
            }
        }
    </script>
    <script>
      function tiaozhuan(num){
          var papercount;
          var arrstr = document.cookie.split("; ");
          for(var i = 0;i < arrstr.length;i ++)
          {
              var temp = arrstr[i].split("=");
              if (temp[0] == "papercount") {
                  papercount = unescape(temp[1]);
              }
          }
          if(num>0&&num<=papercount) {
             window.parent.mainFrame.location.href = "/testinfo?num=" + num;
          }else{
              alert('没有题了');
          }

      }
    </script>
    <link rel="stylesheet" href="stylesheets/testcheck.css"/>
</head>

<body oncontextmenu="return false" style="font-family: 微软雅黑">

    <div style="left: 30px; height: 50px;width:100%; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: #808080;line-height: 50px;">
        <table style="width: 100%;height:50px">
            <tr>
                <td style="text-indent: 30px">
                    <span style="font-weight:bold;font-size: 26px;color:#1C2B36 ">题型：</span>
                    <span style="font-weight:bold;font-size: 40px;color:#FF0214 "><%=questionmark%></span>
                </td>
                <td style="width: 320px"><a id="contentid" onclick="showdiv('contentid','showtext')" style="font-size: 22px; color:1c2b36; cursor:hand"> 查看说明（展开答题说明）</a><img src="images/03test/sq.png" id="image1" onclick="showdiv('contentid','showtext')"/></td>
            </tr>
        </table>
    </div>

    <div id="showtext" style="height: 40px;display:none;line-height: 40px;background-color:#ecf1f5; width:100%; text-indent: 30px;">
        每一道试题下面有A、B、C、D、E五个备选答案，请从中选择一个最佳答案，并用鼠标点击相应题号的相应字母前的方框，以示正确答案。
    </div>

    <div style="height:15px">
    </div>

    <div style="width:95%; padding-left:30px; font-size: 18px; line-height: 40px;" id="testquest">
        <%if(body_id!=0){%>
        <%var tlist=body.split("<br>")%>
           <% for (var k = 0; k < tlist.length; k++) {%>
          <%=tlist[k]%>
          <br>
        <%}%>
        <%}%>
        <div id="num">第<%=num%>题</div>
        <%=question%>
        <br>
        <% var option %>
        <% if(option) { %>
        <% var list=option.split("|") %>
        <% for (var i = 0; i < list.length; i++) {%>
           <%if(list[i].substring(0,1)==select){ %>
           <label style="cursor: hand"><input name="checkbox<%=i%>" type="checkbox" id="checkbox<%=i%>" value="<%=list[i]%>" onclick="SelecteChanged(this);" checked="true"/><%=list[i]%></label>
           <%}else{%>
           <label style="cursor: hand"><input name="checkbox<%=i%>" type="checkbox" id="checkbox<%=i%>" value="<%=list[i]%>" onclick="SelecteChanged(this);"/><%=list[i]%></label>
        <% } %>
           <%if(questionmark!='B1'){%>
            <br>
           <% } %>
        <% } %>
        <% } %>
        <br>
    </div>

    <div style="height:25px"></div>

    <div style="width: 100%; height: 100px; background-color: #FFFFFF; text-align: center; vertical-align: middle; top: 88%; position: fixed; left: 0px;min-width:744px" >
        <input id="Button3" style="border-style:solid; border-radius:5px;font-size: 22px; color: #333333; cursor:hand; background-color: #ECF1F5;height: 60px;width: 120px;border: solid 1px #BFCFDB" type="button" value="<%=mark%>" onclick="biaoyi();" class="btn"/>
        <input id="Button6" style="border-style:solid; border-radius:5px;font-size: 22px; color: #333333; cursor:hand; background-color: #ECF1F5;height: 60px;width: 120px;border: solid 1px #BFCFDB" type="button" value="首页" onclick="tiaozhuan(1);" class="btn"/>
        <input id="Button7" style="border-style:solid; border-radius:5px;font-size: 22px; color: #333333; cursor:hand; background-color: #ECF1F5;height: 60px;width: 120px;border: solid 1px #BFCFDB" type="button" value="上一题" onclick="tiaozhuan(<%=num%>-1);" class="btn"/>
        <input id="Button8" style="border-style:solid; border-radius:5px;font-size: 22px; color: #333333; cursor:hand; background-color: #ECF1F5;height: 60px;width: 120px;border: solid 1px #BFCFDB" type="button" value="下一题" onclick="tiaozhuan(<%=num%>+1);" class="btn"/>
        <input id="Button9" style="border-style:solid; border-radius:5px;font-size: 22px; color: #333333; cursor:hand; background-color: #ECF1F5;height: 60px;width: 120px;border: solid 1px #BFCFDB" type="button" value="末页" onclick="tiaozhuan(<%=papercount%>);" class="btn"/>
        <input id="Button1" type="button" value="完成交卷" onclick="showtoop();" style="border: 1px solid #BFCFDB;border-radius:5px; width: 120px; height: 60px; background-color: #ECF1F5; font-size: 22px; color: #333333;" class="btn"/>
    </div>

    <div id="toop1" style="border-radius:15px;background-position: 0px 0px; border: 1px solid #808080; width: 750px; height: 360px; top: 20%; position:fixed; left: 18%; display:none; background-image: url('images/03test/bj.png'); background-repeat: no-repeat;" >
        <div style="height:80px; font-size: 30px;width:100%; line-height: 80px; text-indent: 20px;border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: #cccccc;">
            <span style="font-size: 24px; color: #4c4c4c;">注意/</span><span style="font-size: 18px; font-family: 'Century Gothic'; color: #4c4c4c">Attention</span>
        </div>
        <div style="height: 20px;"></div>
        <div style="height: 80px; line-height: 80px; text-align: center;">
            <img src="images/03test/lz.png" style="height: 80px; width: 80px" />
        </div>
        <div id="tsone" style="height: 100px; line-height: 50px; font-size: 22px; color: #4c4c4c; margin-left: 180px;">

        </div>
        <div style="text-align:center;height:80px; line-height: 80px;">
            <input id="Button2" type="button" value="确定交卷" onclick="jiaojuan();" style="border-radius:5px;border: 1px solid #BFCFDB; width: 130px; height: 50px; background-color: #34495E; font-size: 20px; color: #ffffff;" class="btn"/>
            <input id="Button10" type="button" value="取消交卷" onclick="showtoop();" style="border-radius:5px;border: 1px solid #bfcfdb; width: 130px; height: 50px; background-color: #34495E; font-size: 20px; color: #ffffff;" class="btn"/>
        </div>
    </div>

    <div id="toop2" style="display:none ; border-radius:15px;background-position: 0px 0px; border: 1px solid #808080; width: 750px; height: 360px; top: 20%; position:fixed; left: 18%; background-image: url('images/03test/bj.png'); background-repeat: no-repeat;">
        <div style="height:80px;line-height: 80px; border-bottom-style: solid; border-bottom-width: 1px; border-bottom-color: #cccccc; text-indent: 20px;">
            <span style="font-size: 24px; color: #4c4c4c;">注意/</span><span style="font-size: 18px; font-family: 'Century Gothic'; color: #4c4c4c">Attention</span></div>
        <div style="height: 20px;"></div>
        <div style="height: 80px; line-height: 80px; text-align: center;">
            <img src="images/03test/lz.png" style="height: 80px; width: 80px" /></div>
        <div id="tsones" style="height: 100px; line-height: 100px; font-size: 22px; color: #4c4c4c; text-align: center;">
            该题尚未答完，确认要离开吗？

        </div>
        <div style="text-align:center; height:80px; line-height: 80px;">
            <input id="Button12" type="button" value="确定" onclick="jiaojuan();" style="border-radius:5px;border: 1px solid #BFCFDB; width: 130px; height: 50px; background-color: #34495E; font-size: 20px; color: #ffffff;" class="btn"/>
            <input id="Button13" type="button" value="取消" onclick="jiaojuan();" style="border-radius:5px;border: 1px solid #BFCFDB; width: 130px; height: 50px; background-color: #34495E; font-size: 20px; color: #ffffff;" class="btn"/>
        </div>
    </div>


</body>
</html>